<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>loading</title>
    <script src="../js/jquery-3.5.1.min.js"></script>
    <style>
        #loading .background {
            display: block;
            width: 100%;
            height: 100%;
            opacity: 0.4;
            filter: alpha(opacity=40);
            background:#fff;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 2000;
        }
        #loading .progressBar {
            border: solid 2px #d00000;
            background: white url('../img/loading2.gif') no-repeat 10px 10px;
        }
        #loading .progressBar {
            display: block;
            width: 160px;
            height: 28px;
            position: fixed;
            top: 50%;
            left: 50%;
            margin-left: -74px;
            margin-top: -14px;
            padding: 10px 10px 10px 50px;
            text-align: left;
            line-height: 27px;
            font-weight: bold;
            position: absolute;
            z-index: 2001;
        }
    </style>
</head>
<body>
    <input type="button" value="loading" onclick="showLoading()">
    <div id="loading" style="display:none;">
        <div id="background" class="background"></div>
        <div id="progressBar" class="progressBar">加载中，请稍候...</div>
    </div>
</body>
<script>
    function showLoading() {
        $('#loading').show();
        setTimeout(function () {
            $('#loading').hide();
        },3000)
    }
</script>
</html>
